package com.ctshk.task.worker.processors;

import com.ctshk.rpc.bus.service.IBusProductService;
import com.ctshk.rpc.system.service.ISysUserService;
import com.github.kfcfans.powerjob.worker.core.processor.ProcessResult;
import com.github.kfcfans.powerjob.worker.core.processor.TaskContext;
import com.github.kfcfans.powerjob.worker.core.processor.sdk.BasicProcessor;
import com.github.kfcfans.powerjob.worker.log.OmsLogger;
import lombok.extern.slf4j.Slf4j;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.stereotype.Component;

/**
 * @description -中汽API产品维护  每日更新一遍
 * @author 彭柳霖
 * @date 2021/3/12
 */
@Slf4j
@Component
public class RglBusProcessor implements BasicProcessor {

    @DubboReference
    private IBusProductService busProductService;

    @Override
    public ProcessResult process(TaskContext context) throws Exception {

        OmsLogger omsLogger = context.getOmsLogger();
//        sysUserService.insertCacheUser();
        // 根据控制台参数判断是否成功
        boolean success = !"failed".equals(context.getJobParams());
        omsLogger.info("InquiryExpiresProcessor finished process,success: .", success);

        return new ProcessResult(success, context + ": " + success);
    }

}
